<%@ control language="C#" autoeventwireup="true" codefile="CountryPicker.ascx.cs"
    inherits="_controls_Common_CountryPicker" %>
<asp:dropdownlist runat="server" id="ddlCountry" datasourceid="countryDataSource"
    datatextfield="EnglishName" datavaluefield="Id" appenddatabounditems="true">
    <asp:listitem selected="true" text="-- Please Select --" value="-1"></asp:listitem>
</asp:dropdownlist>
<asp:objectdatasource id="countryDataSource" runat="server" oldvaluesparameterformatstring="original_{0}"
    selectmethod="FetchAll" typename="MyCityCab.Core.CountryController"></asp:objectdatasource>

<script type="text/javascript" language="javascript">
    $(document).ready(function(){
        $("#<%=ddlCountry.ClientID %>").change(function(){
                var selectedOption = this.options[this.selectedIndex];
                $get("<%=ClientID %>").selectedCountryID = $(selectedOption).val();
        });
    });
</script>

